﻿@model List<Pageparkproject.Models.tblNew>
@{
    ViewBag.Title = "Tin tức thiết kế nội thất";
    Layout = "~/Views/Shared/Layout.cshtml";
}
<div class="main-news">
    <ul>
        @foreach (var item in Model.OrderByDescending(m => m.dDatepost)) 
        { 
        <li>
            <div class="box-news">
                <div class="imgnews-box">
                <a href="@Url.Action("NewsDetail", new {id=item.PK_iNewsID })">
                    <img src="~/Contents/Images/News/@item.sAnh" /></a></div>
                <span class="box-news-title">
                    <a href="@Url.Action("NewsDetail", new {id=item.PK_iNewsID })">
                        @if (item.sTieude.Length > 72)
                        {
                            string tieude = item.sTieude.Substring(0, 72) + "...";
                            <h1>@tieude</h1>
                        }
                        else
                        {
                            <h1>@item.sTieude</h1>
                        }
                </a>
                </span>
                <span class="box-news-tomtat">
                    @if (item.sTomtat.Length > 169)
                    {
                        string tomtat = item.sTomtat.Substring(0, 169) + "...";
                        <p>@tomtat</p>
                    }
                    else
                    {
                        <p>@item.sTomtat</p>
                    }
                </span>
                <a href="@Url.Action("Index", new { id=item.FK_iCategoryNewsID })"><h2>@item.tblCategoryNew.sCategoryName</h2></a>
            </div>
        </li>
        }
    </ul>
</div>